package org.example.gradle.sharding.jdbc.controller;

import gradle.mybatis.common.response.ApiResponse;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import org.example.gradle.sharding.jdbc.entity.OrderQueryDto;
import org.example.gradle.sharding.jdbc.entity.OrderVo;
import org.example.gradle.sharding.jdbc.service.ExampleService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sharding")
public class GradleShardingJdbcDemoController {

    @Resource
    private ExampleService exampleService;

    @Operation(summary = "分运单列表", method = "POST")
    @PostMapping(value = "/listPage")
    public ApiResponse<List<OrderVo>> listPage(@RequestBody OrderQueryDto queryDto) {

        return exampleService.listPage(queryDto);
    }
}
